package cn.wh.beans.factory.support;

import cn.wh.core.io.DefaultResourceLoader;
import cn.wh.core.io.ResourceLoader;

/**
 * @author: wh
 * @create: 2022-10-08 14:38
 * @description
 **/
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader {

    private final BeanDefinitionRegistry registry;

    private ResourceLoader resourceLoader;

    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry, ResourceLoader resourceLoader){
        this.registry=registry;
        this.resourceLoader=resourceLoader;
    }

    protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry){
        this(registry,new DefaultResourceLoader());
    }

    @Override
    public BeanDefinitionRegistry getRegistry() {
        return registry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }
}
